package com.infosystem.demo.repositories;
import com.infosystem.demo.entities.Relative;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface RelativeRepository extends JpaRepository<Relative, String>{
    List<Relative> findByEmployeeId(String employeeId);
    List<Relative> findByName(String name);
    List<Relative> findByJobTitle(String jobTitle);
    List<Relative> findByPoliticalTitle(String politicalTitle);
//    @Query("SELECT r FROM relative r WHERE r.name LIKE :fuzzyName")
//    List<Relative> findByFuzzyName(@Param("fuzzyName") String fuzzyName);
    List<Relative> findByNameContaining(String fuzzyName);

}
